<%-- 
    Document   : TheLoai3
    Created on : Jun 16, 2013, 12:36:43 PM
    Author     : quannq
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:if test="${not empty tl1_3}">${tl1_3}</c:if>
<c:if test="${not empty tl2_3}">${tl2_3}</c:if>
    <table cellpadding="0" cellspacing="0" border="1" class="display example"
           style="color: black;">
        <thead align="center">
            <tr>
                <th>ID</th>
                <th>Tên Thể Loại</th>
                <th>List Sách</th>
                <th>Xóa</th>
            </tr>
        </thead>
        <tbody align="center">
        <c:if test="${fn:length(theloai1.theloai3s) == 0}">
            <tr class="gradeX">
                <td>No data</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </c:if>

        <c:if test="${fn:length(theloai1.theloai3s) > 0}">
            <c:forEach items="${theloai1.theloai3s}" var="tl3">
                <tr class="gradeX">
                    <td>${tl3.matl3}</td>
                    <td><a href="javascript:modalFormUpdate('infotheloai3',${tl3.matl3});">${tl3.tentl3}</a></td>                
                    <td><img src="${pageContext.request.contextPath}/image/admin/view.png" 
                             onclick="loadList('sach', 'listsachtl3',${tl3.matl3});"/></td>
                    <td><c:if test="${fn:length(tl3.sachs)==0}">
                            <img src="${pageContext.request.contextPath}/image/admin/delete.png" />
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </c:if>
    </tbody>
</table>
<script type="text/javascript">
                                 $(document).ready(function() {
                                     $('.example').dataTable({
                                         "aaSorting": [[0, "desc"]],
                                         "fnRowCallback": function(nRow, aData, iDisplayIndex) {
                                             var index = 0;
                                             var subscriberId = aData[index];

                                             return nRow;
                                         },
                                         "aoColumnDefs": [{
                                                 "aTargets": [0]
                                             }],
                                         "sPaginationType": "full_numbers"
                                     });
                                 });
</script>
